package cn.edu.cimv.service.impl;

import cn.edu.cimv.dao.entity.Direction;
import cn.edu.cimv.dao.entity.Option;
import cn.edu.cimv.dao.mapper.OptionMapper;
import cn.edu.cimv.service.OptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 门铎 on 2016/11/24.
 */
@Service
public class OptionServiceImpl implements OptionService {
    @Autowired private OptionMapper optionMapper;

    /**
     * 查询标题分类
     * @param cataType
     * @return
     */
    @Override
    public List<Option> queryTitles(String cataType) {
        return optionMapper.queryTitles(cataType);
    }

    @Override
    public Option queryTitlesById(int id) {
        return optionMapper.queryTitlesById(id);
    }

    /**
     * 插入分类
     * @param option
     */
    @Override
    public void insertOption(Option option) {
        optionMapper.insertOption(option);
    }

    @Override
    public void updateOption(Option option) {
        optionMapper.updateOption(option);
    }

    @Override
    public void deleteOption(int id) {
        optionMapper.deleteOption(id);
    }

    @Override
    public List<Direction> queryDirections() {
        return optionMapper.queryDirections();
    }

    @Override
    public void insertDirection(Direction direction) {
        optionMapper.insertDirection(direction);
    }

    @Override
    public void updateDirection(Direction direction) {
        optionMapper.updateDirection(direction);
    }

    @Override
    public void deleteDirection(int id) {
        optionMapper.deleteDirection(id);
    }

    @Override
    public Direction queryDirectionsById(int id) {
        return optionMapper.queryDirectionsById(id);
    }
}
